home *** CD-ROM | disk | FTP | other *** search
/ Zoom 2 / Zoom - Release 2 (1996)(Active Software)[!].iso / programming / assembly / ex4_number2 / aedoor_lib.s / aedoor_lib.s
Encoding:
Text File  |  1992-09-02  |  13.7 KB  |  506 lines

  1. *******************************************************************************
  2. * Ami-Express /X3.xx 'amix.Library'           Copyright © 1994 2-Cool/EX4!
  3. * ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
  4. * $Release    : 0.1 $
  5. * $Revision    : 1.02 $
  6. * $Date        : 02-Jan-93 $
  7. *
  8. * $Authors    : Written by 2-Cool/EX4
  9. *
  10. * $Purpose    : An Ami-Express Door Interface library for AmiX 'door modules'
  11. *        : Compatible with AEDoor library with more functions
  12. *******************************************************************************
  13. AbsExecBase    =    4
  14. xid_syslib    =    34
  15. xid_seglist    =    42
  16.  
  17. ;-------------- Definition Includes
  18.  
  19.         incdir    "includes:"
  20.         include    "exec/exec.i"
  21.         include    "exec/exec_lib.i"
  22.  
  23.         include    "exec/types.i"
  24.         include    "exec/initializers.i"
  25.         include    "exec/libraries.i"
  26.         include    "exec/lists.i"
  27.         include    "exec/nodes.i"
  28.         include    "exec/resident.i"
  29.         
  30.         include    "libraries/dos.i"
  31.         include    "libraries/dos_lib.i"
  32.         include    "amix/amix.i"
  33.  
  34. CALL        macro
  35.         jsr    _LVO\1(a6)
  36.         endm
  37.  
  38. DummyEntry:    moveq    #-1,d0    ;Tell all fools trying to execute us
  39.         rts        ;that our execution failed. ;-)
  40.  
  41.  
  42. Resident:    dc.w    RTC_MATCHWORD
  43.         dc.l    Resident
  44.         dc.l    ResEnd
  45.         dc.b    RTF_AUTOINIT
  46.         dc.b    1                ;version
  47.         dc.b    NT_LIBRARY
  48.         dc.b    0                ;task Pri
  49.         dc.l    LibName
  50.         dc.l    IdString
  51.         dc.l    Init
  52.  
  53. LibName:    dc.b    'amix.library',0
  54. IdString:    dc.b    '$VER: amix.library v1.02'
  55.         dc.b    ' (02-Jan-94)',13,10,0
  56.         EVEN
  57. ResEnd:
  58.  
  59. Init:        dc.l    200            ;AXLib_SIZEOF
  60.         dc.l    FuncTable        ;-6
  61.         dc.l    DataTable        ;-5
  62.         dc.l    InitRoutine        ;-4
  63.  
  64. ; --- sys
  65. FuncTable:    dc.l    Open            ;-3
  66.         dc.l    Close            ;-2
  67.         dc.l    Expunge            ;-1
  68.         dc.l    Null            ;0
  69.  
  70.         dc.l    _LVOCreateComm        ;01: create comms channel
  71.         dc.l    _LVODeleteComm        ;02: delete comms channel
  72.         dc.l    _LVOSendCmd        ;03: send a cmd
  73.         dc.l    _LVOSendStrCmd        ;04: send string & cmd
  74.         dc.l    _LVOSendDataCmd        ;05: send cmd & data
  75.         dc.l    _LVOSendStrDataCmd    ;06: send string & cmd & data
  76.         dc.l    _LVOGetData        ;07: get data ptr
  77.         dc.l    _LVOGetString        ;08: get string ptr
  78.         dc.l    _LVOPrompt        ;09: prompt for a string
  79.         dc.l    _LVOWriteStr        ;10: send a text string
  80.         dc.l    _LVOShowGFile        ;11: show an /X File
  81.         dc.l    _LVOShowFile        ;12: show a text file
  82.         dc.l    _LVOSetDT        ;13: set data
  83.         dc.l    _LVOGetDT        ;14: get data
  84.         dc.l    _LVOGetStr        ;15: get string
  85.         dc.l    _LVOCopyStr        ;16: make a fast copy of string
  86.         dc.l    _LVOHotKey        ;17: wait for keypress
  87.         dc.l    -1
  88.  
  89. DataTable:    INITBYTE    LH_TYPE,NT_LIBRARY
  90.         INITLONG    LN_NAME,LibName
  91.         INITBYTE    LIB_FLAGS,LIBF_SUMUSED+LIBF_CHANGED
  92.         INITWORD    1,1
  93.         INITWORD    2,1
  94.         INITLONG    LIB_IDSTRING,IdString
  95.         dc.l    0
  96.  
  97. InitRoutine:    move.l    a5,-(a7)
  98.         move.l    d0,a5
  99.         move.l    a6,xid_SysLib(a5)        ;34
  100.         move.l    a0,xid_SegList(a5)        ;42
  101.         move.l    (a7)+,a5
  102.         rts
  103.  
  104. ;--- sys entries
  105.  
  106. Open:        addq.w    #1,LIB_OPENCNT(a6)
  107.         bclr.b    #LIBB_DELEXP,LIB_FLAGS(a6)
  108.         move.l    a6,d0
  109. rts00:        rts
  110.  
  111.  
  112. Close:        moveq    #0,d0
  113.         subq.w    #1,LIB_OPENCNT(a6)
  114.         bne.s    rts00
  115.         btst.b    #LIBB_DELEXP,LIB_FLAGS(a6)
  116.         beq.s    rts00
  117.  
  118.     ;;; Fall through to Expunge and remove the lib from memory.
  119.  
  120. Expunge:    movem.l    d1-d2/a5-a6,-(a7)
  121.         move.l    a6,a5
  122.         move.l    xid_SysLib(a5),a6
  123.         tst.w    LIB_OPENCNT(a5)
  124.         beq.s    exp1
  125.         bset.b    #LIBB_DELEXP,LIB_FLAGS(a5)
  126.         moveq    #0,d0
  127.         bra.s    expEnd
  128.  
  129. exp1:        move.l    xid_SegList(a5),d2
  130.         move.l    a5,a1
  131.         CALL    Remove
  132.         moveq    #0,d0
  133.         move.l    a5,a1
  134.         move.w    LIB_NEGSIZE(a5),d0
  135.         sub.l    d0,a1
  136.         add.w    LIB_POSSIZE(a5),d0
  137.         CALL    FreeMem
  138.         move.l    d2,d0
  139. expEnd:        movem.l    (a7)+,d1-d2/a5-a6
  140.         rts
  141.  
  142. Null:        moveq    #0,d0
  143.         rts
  144.  
  145. *******************************************************************************
  146. * CreateComm() : Creates a door Communication Channel
  147. * ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
  148. * INPUTS:    d0 = Node Number (AS ASCII!)
  149. * OUTPUTS:    d0 = Ptr to DoorInterface Structure (DIFStruct)
  150. *******************************************************************************
  151.  
  152. _LVOCreateComm:    cmp.b    #10,d0
  153.         bne.b    NodeOk
  154. _SignalFailed:    moveq    #0,d0                ;CreateComm failed
  155.         rts
  156. memfail        moveq    #-1,d0
  157.         rts
  158.  
  159. NodeOk:        lea    _Arg1(pc),a4
  160.         move.b    d0,(a4)
  161.         move.b    d0,_Arg2-_Arg1(a4)
  162.  
  163.         move.l    (AbsExecBase).w,a6    ;get execbase
  164.         move.l    #236,d0            ;length for our port store
  165.         move.l    #MEMF_PUBLIC+MEMF_CLEAR,d1 ;we want public mem, cleared
  166.         CALL    AllocMem        ;allocate it...
  167.         move.l    d0,DIFStructPt-_Arg1(a4) ;ptr to our RS.Variables base
  168.         beq.s    memfail
  169.  
  170.         moveq    #-1,d0
  171.         jsr    _LVOAllocSignal(a6)
  172.         cmp.b    #$FF,d0
  173.         beq.s    _SignalFailed
  174.  
  175.         lea    _MsgSt(pc),a0
  176.         move.b    d0,Signal-_MsgSt(a0)
  177.         move.b    d0,15(a0)
  178.         sf.b    9(a0)
  179.         move.b    #4,8(a0)
  180.         sf.b    14(a0)
  181.         lea    DRPort.txt(pc),a1
  182.         move.l    a1,10(a0)
  183.         suba.l    a1,a1
  184.         jsr    _LVOFindTask(a6)
  185.  
  186.         lea    _MsgSt(pc),a1
  187.         move.l    d0,16(a1)
  188.         jsr    _LVOAddPort(a6)
  189.  
  190. DoorReplyMsg:    move.l    DIFStructPt(pc),a3
  191.         move.b    #5,8(a3)
  192.         move.w    #236,18(a3)
  193.  
  194.         lea    _MsgSt(pc),a1
  195.         move.l    a1,14(a3)
  196.         moveq    #-1,d0
  197.         move.l    d0,228(a3)
  198.         clr.l    232(a3)
  199.         moveq    #2,d0
  200.         move.l    d0,220(a1)
  201.         moveq    #1,d0
  202.         move.l    d0,224(a3)
  203.  
  204.         lea    DRPort.txt(pc),a0        ;source
  205.         move.l    a3,a1                ;DIFStruct
  206.         bsr.w    _LVOPutStr            ;put into DIFStruct
  207.  
  208.         lea    AEDoorPort.MSG(pc),a1
  209. GetPort:    move.l    (AbsExecBase).w,a6
  210.         jsr    _LVOFindPort(a6)
  211.         move.l    d0,_PortBase
  212.         beq.s    GetPort
  213.  
  214.         bsr.w    _PutPortMsg
  215.  
  216.         moveq    #0,d1
  217.         move.b    Signal(pc),d1
  218.         moveq    #1,d0
  219.         asl.l    d1,d0
  220.         move.l    (AbsExecBase).w,a6
  221.         jsr    _LVOWait(a6)
  222.         lea    _MsgSt(pc),a0
  223.         jsr    _LVOGetMsg(a6)
  224.  
  225.         move.l    DIFStructPt(pc),a0
  226.         lea    20(a0),a1        ;String-DIFStruct(a0),a1
  227.         move.l    a1,StringPtr-_Arg1(a4)
  228.         lea    220(a0),a1        ;Data-DIFStruct(a0),a1
  229.         move.l    a1,DataPtr-_Arg1(a4)
  230.         move.l    a0,d0
  231.         rts
  232.  
  233. *******************************************************************************
  234. * DeleteComm() : Deletes our door Communication Channel
  235. * ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
  236. * INPUTS:    a1 = Ptr to DoorInterface Structure (DIFStruct)
  237. *******************************************************************************
  238.  
  239. _LVODeleteComm:    move.l    a1,a0
  240.         move.l    #2,$E0(a0)
  241.         bsr.w    _PutPortMsg
  242.  
  243.         moveq    #0,d1
  244.         move.b    Signal(pc),d1
  245.         moveq    #1,d0
  246.         asl.l    d1,d0
  247.         move.l    (AbsExecBase).w,a6
  248.         jsr    _LVOWait(a6)
  249.  
  250.         lea    _MsgSt(pc),a0
  251.         jsr    _LVOGetMsg(a6)
  252.  
  253.         lea    _MsgSt(pc),a1
  254.         jsr    _LVORemPort(a6)
  255.  
  256.         lea    _MsgSt(pc),a0
  257.         moveq    #-1,d0
  258.         move.l    d0,$10(a0)
  259.         move.l    d0,$14(a0)
  260.  
  261.         moveq    #0,d0
  262.         move.b    Signal(pc),d0
  263.         move.l    (AbsExecBase).w,a6
  264.         jsr    _LVOFreeSignal(a6)
  265.  
  266.         move.l    DIFStructPt(pc),a1    ;ptr to our RS.Variables base
  267.         move.l    #236,d0            ;no. of bytes to free
  268.         jmp    _LVOFreeMem(a6)        ;free the memory
  269.  
  270. *******************************************************************************
  271. * Prompt()    : Prompt user for an input string
  272. * ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
  273. * INPUTS:    a0 = Prompt String
  274. *        a1 = DIFStruct
  275. *        d1 = String Length
  276. *******************************************************************************
  277.  
  278. _LVOPrompt    moveq    #JH_PM,d0
  279.         bsr.s    _LVOSendStrDataCmd
  280.         move.l    StringPtr(pc),a0
  281.         move.l    a0,d0
  282.         move.l    DataPtr(pc),a0
  283.         cmp.l    #-1,(a0)
  284.         beq.s    .carrier_lost
  285.         rts
  286. .carrier_lost    moveq    #0,d0
  287.         rts
  288.  
  289. _LVOGetString    move.l    StringPtr(pc),a0
  290.         rts
  291. _LVOGetData    move.l    DataPtr(pc),a0
  292.         rts
  293.  
  294. *******************************************************************************
  295. * HotKey()    : Prompt user for key
  296. * ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
  297. * INPUTS:    a0 = Hotkey String
  298. *        a1 = DIFStruct
  299. *******************************************************************************
  300.  
  301. _LVOHotkey    moveq    #JH_HK,d0
  302.         bsr.s    _LVOSendStrCmd
  303.         move.l    DataPtr(pc),a0
  304.         move.l    (a0),d0
  305.         bmi.s    .carrier_lost
  306.         move.l    StringPtr(pc),a0
  307.         moveq    #0,d0
  308.         move.b    (a0),d0            ;d0=key
  309.         moveq    #0,d1            ;d1=0
  310. .carrier_lost:    rts
  311.  
  312. *******************************************************************************
  313. * GetStr()    : Get string
  314. * ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
  315. * INPUTS:    a0 = String
  316. *        a1 = DIFStruct
  317. *******************************************************************************
  318.  
  319. _LVOGetStr    moveq    #0,d0
  320.         bsr.s    _LVOSendStrDataCmd
  321.         move.l    DataPtr(pc),a0
  322.         cmp.l    #-1,(a0)
  323.         beq.s    .carrier_lost
  324.         move.l    StringPtr(pc),d0
  325. .carrier_lost:    rts
  326.         
  327. *******************************************************************************
  328. * SetDT()    : 
  329. * ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
  330. * INPUTS:    a0 = ASCIIZ String
  331. *        a1 = DIFStruct
  332. *        d1 = Data ID
  333. *******************************************************************************
  334.  
  335. _LVOSetDT    moveq    #0,d0
  336.         bra.s    _LVOSendStrDataCmd
  337.  
  338. *******************************************************************************
  339. * GetDT()    : 
  340. * ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
  341. * INPUTS:    a0 = ASCIIZ String
  342. *        a1 = DIFStruct
  343. *        d1 = Data ID
  344. *******************************************************************************
  345.  
  346. _LVOGetDT    moveq    #1,d0
  347.         bra.s    _LVOSendStrDataCmd
  348.  
  349. *******************************************************************************
  350. * ShowFile()    : Shows an /X File
  351. * ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
  352. * INPUTS:    a0 = ASCIIZ String
  353. *        a1 = DIFStruct
  354. *******************************************************************************
  355.  
  356. _LVOShowGFile    moveq    #JH_SG,d0
  357.         bra.s    _LVOSendStrCmd
  358.  
  359. *******************************************************************************
  360. * ShowFile()    : Shows a File
  361. * ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
  362. * INPUTS:    a0 = ASCIIZ String
  363. *        a1 = DIFStruct
  364. *******************************************************************************
  365.  
  366. _LVOShowFile    moveq    #JH_SF,d0
  367.         
  368. *******************************************************************************
  369. * SendStrCmd()    : Sends a text string and command
  370. * ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
  371. * INPUTS:    a0 = ASCIIZ String
  372. *        a1 = DIFStruct
  373. *        d0 = AECommand
  374. *******************************************************************************
  375.  
  376. _LVOSendStrCmd:    move.l    a1,-(sp)
  377.         bsr.b    _LVOPutStr        ;put into DIFStruct
  378.         move.l    (sp)+,a1
  379.         bra.s    _LVOSendCmd
  380.  
  381. *******************************************************************************
  382. * WriteStr():    Sends a text string
  383. * ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
  384. * INPUTS:    a0 = ASCIIZ String
  385. *        a1 = DIFStruct
  386. *        d1 = LF/NOLF
  387. *******************************************************************************
  388.  
  389. _LVOWriteStr    moveq    #4,d0            ;JH_SM
  390.  
  391. *******************************************************************************
  392. * SendStrDataCmd(): Sends a text string and data command
  393. * ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
  394. * INPUTS:    a0 = ASCIIZ String
  395. *        a1 = DIFStruct
  396. *        d0 = AECommand
  397. *******************************************************************************
  398.  
  399. _LVOSendStrDataCmd:
  400.         move.l    a1,-(sp)
  401.         bsr.b    _LVOPutStr        ;put into DIFStruct
  402.         move.l    (sp)+,a1
  403.         
  404. *******************************************************************************
  405. * SendDataCmd()    : Sends an /X Data & Command request
  406. * ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
  407. * INPUTS:    d0 = AECommand
  408. *         d1 = Data
  409. *        a1 = DIFStruct
  410. *******************************************************************************
  411.  
  412. _LVOSendDataCmd:
  413.         move.l    d1,$DC(a1)
  414.  
  415. ;-------------- falls through to SendCmd
  416.  
  417.  
  418. *******************************************************************************
  419. * SendCmd()    : Sends a simple /X Command request
  420. * ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
  421. * INPUTS:    d0 = AECommand
  422. *        a1 = DIFStruct
  423. *******************************************************************************
  424.  
  425. _LVOSendCmd:    move.l    d0,$E0(a1)        ;JH_SM
  426.         bsr.s    _PutPortMsg
  427.         lea    _MsgSt(pc),a0
  428.         move.l    (AbsExecBase).w,a6
  429.         jsr    _LVOWaitPort(a6)
  430.         lea    _MsgSt(pc),a0
  431.         jmp    _LVOGetMsg(a6)
  432.  
  433. _PutPortMsg:    move.l    _PortBase(pc),a0
  434.         move.l    DIFStructPt(pc),a1
  435.         move.l    (AbsExecBase).w,a6
  436.         jmp    _LVOPutMsg(a6)
  437.  
  438. *******************************************************************************
  439. * CopyStr()    : Extracts ASCIIZ string (from DIFStruct) to <Destination>
  440. * ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
  441. * INPUTS:    a0 = Destination
  442. *        a1 = DIFStruct
  443. *******************************************************************************
  444.  
  445. _LVOCopyStr:    move.l    a0,a2            ;a2=<destination>
  446.         lea    5*4(a1),a1        ;a1=<source>
  447.         bra.w    ByteCopy
  448.  
  449. *******************************************************************************
  450. * PutStr()    : Inserts ASCIIZ string (from <SOURCE>) into DIFString
  451. * ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
  452. * INPUTS:    a0 = Source
  453. *        a1 = DIFStruct
  454. *******************************************************************************
  455.  
  456. _LVOPutStr:    lea    5*4(a1),a2        ;a2=<destination>
  457.         move.l    a0,a1            ;a1=<source)
  458.  
  459. ;-------------- fall through to byte copy
  460.  
  461. *******************************************************************************
  462. * ByteCopy()    : Copies an ASCIIZ string , <source> to <dest>
  463. * ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
  464. * INPUTS:    a1 = source
  465. *        a2 = dest
  466. *******************************************************************************
  467.  
  468. ByteCopy:    moveq    #-1,d5
  469. copyloop:    addq.b    #1,d5
  470.         cmp.b    #200-1,d5    ;string > 200 bytes?
  471.         beq.s    clearbyte    ;if so null terminate it and exit...
  472.         move.b    (a1)+,(a2)+
  473.         bne.s    copyloop
  474. clearbyte:    clr.b    (a2)        ;null string
  475.         rts
  476.  
  477. _PortBase:    ds.l    1
  478. _MsgSt:        ds.l    8
  479. StringPtr    ds.l    1
  480. DataPtr        ds.l    1
  481. DIFStructPt:    ds.l    1        ;ptr to 236 bytes of memory
  482.          
  483. ;-------------- AEDoor Interface Messsage Structure
  484. ;
  485. ;DIFStruct:    ds.l    1        ;000 : Msg_Ax1     (001 ULONG PTR)
  486. ;        ds.l    1        ;004 : Msg_Ax2     (001 ULONG PTR)
  487. ;        ds.l    1        ;008 : Msg_Ax3     (001 ULONG PTR)
  488. ;        ds.l    1        ;012 : Msg_Ax4     (001 ULONG PTR)
  489. ;        ds.l    1        ;016 : Msg_Ax5     (001 ULONG PTR)
  490. ;        ds.b    200        ;216 : Msg_String  (200 UBYTES)
  491. ;        ds.l    1        ;220 : Msg_Data    (001 ULONG PTR)
  492. ;        ds.l    1        ;224 : Msg_Command (001 ULONG PTR)
  493. ;        ds.l    1        ;228 : Msg_NodeID  (001 ULONG PTR)
  494. ;        ds.l    1        ;232 : Msg_LineNo  (001 ULONG PTR)
  495.  
  496. DRPort.txt:    dc.b    'DoorReplyPort'
  497. _Arg1:        dc.b    0,0,0
  498.         even
  499. AEDoorPort.MSG:    dc.b    'AEDoorPort'
  500. _Arg2:        dc.b    0,0,0
  501.         even
  502. Signal:        dc.b    0
  503.         even
  504.  
  505.         end
  506.